package com.example.jf.jfapp.bean.response;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by jf on 2017/7/27.
 */

public class BlogResponse {

    private List<ResultBean> result;

    public List<ResultBean> getResult() {
        return result;
    }

    public void setResult(List<ResultBean> result) {
        this.result = result;
    }

    public static class ResultBean implements Parcelable {
        /**
         * author : {"followeeStatus":false,"followees":0,"follower":0,"headProtrait":"http://ac-EkMW81DI.clouddn.com/ltrCba7u5FjLajbuEEDFsxHA1gUggTDGt3xqmSh1.jpg","specialty":[],"userId":"59734e14ac502e0061a43bae","username":"weidong"}
         * blogId : 597358d461ff4b006c600c4d
         * blogType : 3
         * commentsSize : 5
         * contentArr : ["我是内容1","http://pic.qiantucdn.com/58pic/17/80/90/5594c127301c7_1024.jpg","我是内容2","http://c.hiphotos.baidu.com/zhidao/pic/item/a2cc7cd98d1001e9bba6d84cb80e7bec55e797df.jpg","我是内容3","http://img2.imgtn.bdimg.com/it/u=3515419095,1393895062&fm=214&gp=0.jpg"]
         * likeSize : 0
         * likeSizeStatus : false
         * timestamp : 1500731604300
         * title : 我是类型3   第1条
         */

        private AuthorBean author;
        private String blogId;
        private int blogType;
        private int commentsSize;
        private int likeSize;
        private boolean likeSizeStatus;
        private long timestamp;
        private String title;
        private List<String> contentArr;

        protected ResultBean(Parcel in) {
            author = in.readParcelable(AuthorBean.class.getClassLoader());
            blogId = in.readString();
            blogType = in.readInt();
            commentsSize = in.readInt();
            likeSize = in.readInt();
            likeSizeStatus = in.readByte() != 0;
            timestamp = in.readLong();
            title = in.readString();
            contentArr = in.createStringArrayList();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeParcelable(author, flags);
            dest.writeString(blogId);
            dest.writeInt(blogType);
            dest.writeInt(commentsSize);
            dest.writeInt(likeSize);
            dest.writeByte((byte) (likeSizeStatus ? 1 : 0));
            dest.writeLong(timestamp);
            dest.writeString(title);
            dest.writeStringList(contentArr);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<ResultBean> CREATOR = new Creator<ResultBean>() {
            @Override
            public ResultBean createFromParcel(Parcel in) {
                return new ResultBean(in);
            }

            @Override
            public ResultBean[] newArray(int size) {
                return new ResultBean[size];
            }
        };

        public AuthorBean getAuthor() {
            return author;
        }

        public void setAuthor(AuthorBean author) {
            this.author = author;
        }

        public String getBlogId() {
            return blogId;
        }

        public void setBlogId(String blogId) {
            this.blogId = blogId;
        }

        public int getBlogType() {
            return blogType;
        }

        public void setBlogType(int blogType) {
            this.blogType = blogType;
        }

        public int getCommentsSize() {
            return commentsSize;
        }

        public void setCommentsSize(int commentsSize) {
            this.commentsSize = commentsSize;
        }

        public int getLikeSize() {
            return likeSize;
        }

        public void setLikeSize(int likeSize) {
            this.likeSize = likeSize;
        }

        public boolean isLikeSizeStatus() {
            return likeSizeStatus;
        }

        public void setLikeSizeStatus(boolean likeSizeStatus) {
            this.likeSizeStatus = likeSizeStatus;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(long timestamp) {
            this.timestamp = timestamp;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public List<String> getContentArr() {
            return contentArr;
        }

        public void setContentArr(List<String> contentArr) {
            this.contentArr = contentArr;
        }

        public static class AuthorBean implements Parcelable {
            /**
             * followeeStatus : false
             * followees : 0
             * follower : 0
             * headProtrait : http://ac-EkMW81DI.clouddn.com/ltrCba7u5FjLajbuEEDFsxHA1gUggTDGt3xqmSh1.jpg
             * specialty : []
             * userId : 59734e14ac502e0061a43bae
             * username : weidong
             */

            private boolean followeeStatus;
            private int followees;
            private int follower;
            private String headProtrait;
            private String userId;
            private String username;
            private List<?> specialty;

            protected AuthorBean(Parcel in) {
                followeeStatus = in.readByte() != 0;
                followees = in.readInt();
                follower = in.readInt();
                headProtrait = in.readString();
                userId = in.readString();
                username = in.readString();
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeByte((byte) (followeeStatus ? 1 : 0));
                dest.writeInt(followees);
                dest.writeInt(follower);
                dest.writeString(headProtrait);
                dest.writeString(userId);
                dest.writeString(username);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public static final Creator<AuthorBean> CREATOR = new Creator<AuthorBean>() {
                @Override
                public AuthorBean createFromParcel(Parcel in) {
                    return new AuthorBean(in);
                }

                @Override
                public AuthorBean[] newArray(int size) {
                    return new AuthorBean[size];
                }
            };

            public boolean isFolloweeStatus() {
                return followeeStatus;
            }

            public void setFolloweeStatus(boolean followeeStatus) {
                this.followeeStatus = followeeStatus;
            }

            public int getFollowees() {
                return followees;
            }

            public void setFollowees(int followees) {
                this.followees = followees;
            }

            public int getFollower() {
                return follower;
            }

            public void setFollower(int follower) {
                this.follower = follower;
            }

            public String getHeadProtrait() {
                return headProtrait;
            }

            public void setHeadProtrait(String headProtrait) {
                this.headProtrait = headProtrait;
            }

            public String getUserId() {
                return userId;
            }

            public void setUserId(String userId) {
                this.userId = userId;
            }

            public String getUsername() {
                return username;
            }

            public void setUsername(String username) {
                this.username = username;
            }

            public List<?> getSpecialty() {
                return specialty;
            }

            public void setSpecialty(List<?> specialty) {
                this.specialty = specialty;
            }
        }
    }
}
